package com.nommon.tool;

import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.RectF;

public class CanvasTool {

	public static RectF pctToScr(int x, int y, int w, int h, Canvas canvas) {
		return pctToScr(new Rect(x, y, x+w, y+h), canvas);
	}
	
	public static RectF pctToScr(Rect rect, Canvas canvas) {
		return new RectF(rect.left/100f*canvas.getWidth(), rect.top/100f*canvas.getHeight(), rect.right/100f*canvas.getWidth(), rect.bottom/100f*canvas.getHeight());
	}
}
